<?php
/*<h1> <?php  echo $this->mensaje ?> </h1>*/

//----------------------------------------------------------------------
  // Sophia
  // Sophia by Alex Olave - http://www.alfazeta.cl
  //----------------------------------------------------------------------

  //----------------------------------------------------------------------
  // Author: 	Alex Olave - http://www.alfazeta.cl
  // Copyright: copyright (C) 2012 - Alex Olave.
  // License: 	GNU/GPL, http://www.gnu.org/copyleft/gpl.html
  // Pack: 	Sophia
  //----------------------------------------------------------------------

  //----------------------------------------------------------------------
  // Sophia is free software. This version may have been modified pursuant
  // to the GNU General Public License, and as distributed it includes or
  // is derivative of works licensed under the GNU General Public License or
  // other free or open source software licenses.
  //----------------------------------------------------------------------


defined( '_JEXEC' ) or die( 'Restricted access' );

JHTML::_('behavior.mootools');
JHTML::_('behavior.tooltip');  
//require_once( JPATH_ADMINISTRATOR . DS .'components' . DS . 'com_sophia' . DS . 'helpers'.DS.'load.helper.php' );
// Create shortcuts to some parameters.
$params		= $this->params;

$pane1 =& JPane::getInstance('tabs');

$k = 0;
		for ($i=0, $n=count( $this->alumno ); $i < $n; $i++)
		{
			$row = &$this->alumno[$i];

			$checked 	= JHTML::_('grid.id',  $i, $row->id );
			$published 	= JHTML::_('grid.published', $row, $i );
	
?>

	        <table class="adminlist" border ="0">
	          <thead>
			  <tr>
	            <th style="width:290px; font-size:18px " nowrap="nowrap" align="center">
							<?php echo $row->nombre; ?>	
							<span  style="font-size:12px">(<?php echo $row->curso; ?>)</span> &nbsp;&nbsp;&nbsp; 
	            </th>
	              <th align="left"><?php echo JText::_( 'GLOSA_ALUMNO' ); ?></th>
	            </tr>
	         </thead>
			  </table>
<?php
		}
		echo $pane1->startPane( 'pane1' );
		echo $pane1->startPanel( JTEXT::_('Notas'), 'nom_cp_notas' );
		echo '<div id="cpanel">';
		//if ($this->params->get('show_icons'){ 
		echo SophiaHelperToolbar::IconButtonPdf( 'infopdf', 'icons/pdf_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		//echo SophiaHelperToolbar::IconButtonPdf( 'print', 'icons/printer_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		//}
		
?>
		<table class="adminlist" border ="0">
			<thead>
				<tr>
					<th width="15%" >
						<?php echo JHTML::_('grid.sort',  'asignatura', 'asignatura', @$lists['order_Dir'], @$lists['order'] ); ?>
					</th>
					<th width="20" scope="col" >
					   <?php echo JText::_( ' N O T A S' ); ?>
					</th>	
					<th width="10%" >
							<?php echo JText::_( 'P.P.1' ); ?>
					</th>	
					<th width="10%" >
							<?php echo JText::_( 'P.F' ); ?>
					</th>	
					<th width="10%" >
							<?php echo JText::_( 'P.C' ); ?>
					</th>	
				</tr>
			</thead>
			
			<?php
			$k = 0;
			$prom=0;
			$calculo=0;
			for ($i=0, $n=count( $this->asignaturas ); $i < $n; $i++)
		    {
			$row = &$this->asignaturas[$i];
			?>
				<tr class="<?php echo "row$k"; ?>">
					<td align="left">
					<?php echo $row->asignatura; ?>
					</td>
					<td align="left">
					<table class="adminlist" border ="0">
					<tbody>
					<?php
					
					for ($x=0, $con=count( $this->notas ); $x < $con; $x++)
				    {
						$rownotas = &$this->notas[$x];
					if ($rownotas->asignatura == $row->asignatura) {
						
					
						?>	
						<td>
						 <span class="hasTip" title="<?php echo JText::_( 'Evaluacion' ); ;?>::<?php echo $rownotas->titulo ;?>"> 
							<?php echo $rownotas->nota.'x'.$rownotas->coeficiente;?>
						</span>
						</td>
						<?php
					   }	
					}
					?>
					</tbody>
					</table>
					</td>
					<td align="center">
						<?php echo round($row->promedio,2);?>
					</td>
					<td align="center">
						<?php echo round($row->promedio,2);?>
					</td>
					<td align="center">
						<?php  
						echo round($row->promedio,2);
						
						?>
					</td>
				</tr>
				<?php
				$k = 1 - $k;
				$calculo1 = $row->promedio;
				$calculo = $calculo + $calculo1;  
				$prom++;
			}
			?>
		</table>
		<br>
		<br>
		<table class="adminlist" border ="0">
			<thead>
				<tr>
					<th width="70%" align="left">
						<?php echo JText::_( 'Promedio General del alumno :' ); ?>
					 </th>
					<th width="10%" ><?php @$Resultado = ($calculo / $prom ); ?><?php echo round($Resultado,2); ?></th>	
					<th width="10%" ></th>	
					<th width="10%" ></th>	 
				</tr>	
			</thead>
	  	</table>
		<br>
		<br>
		<table border ="0" >
			<thead>
				<tr>
					<th width="90%">
						<?php echo JText::_( 'DEFINICION_SIGLAS' ); ?>
					 </th>
				</tr>
			</thead>
	  	</table>
	
	
	<table class="adminlist">
		<tbody>
		<tr>
			<td width="20%" class="key">
			</td>
			<td width="80%">
			</td>
		</tr>	
		<?php
		echo '</div>';
		
		?>
		</tbody>
	</table>
	<?php
		echo $pane1->endPanel();
		echo $pane1->startPanel( JTEXT::_('Anotaciones'), 'nom_cp_anotaciones' );
		echo '<div id="cpanel">';
		//echo SophiaHelperToolbar::IconButtonPdf( 'pdf', 'icons/pdf_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		//echo SophiaHelperToolbar::IconButtonPdf( 'print', 'icons/printer_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		
	?>
			<table class="adminlist" border ="0">
			<thead>
				<tr>
					<th width="15%" >
						<?php echo JHTML::_('grid.sort',  'fecha', 'Fecha', @$lists['order_Dir'], @$lists['order'] ); ?>
					</th>
					<th width="50" scope="col" >
					   <?php echo JText::_( ' A N O T A C I O N E S' ); ?>
					</th>	
					<th width="30%" >
							<?php echo JText::_( 'Periodo' ); ?>
					</th>	
				</tr>
			</thead>
			
			<?php
			$k = 0;
			for ($i=0, $n=count( $this->anotaciones ); $i < $n; $i++)
		    {
			$row = &$this->anotaciones[$i];
			?>
				<tr class="<?php echo "row$k"; ?>">
					<td align="left">
						<?php echo $row->fecha; ?>
					</td>
					<td align="left">
						<?php echo $row->anotacion?>
					</td>
					<td align="center">
						<?php echo $row->periodo;?>
					</td>
				</tr>
				<?php
				$k = 1 - $k;
			}
			?>
		</table>

	<?php
	echo '</div>';
	// nuevo panel 
		echo $pane1->endPanel();
		echo $pane1->startPanel( JTEXT::_('Inacistencias / Atrasos'), 'nom_cp_inasistencias' );
		echo '<div id="cpanel">';
		$imgY = 'components/com_sophia/images/icons/circulo_amarillo.jpg';
		$imgX = 'components/com_sophia/images/icons/circulo_naranjo.jpg';		
		?>
				<table class="adminlist" border ="0">
			<thead>
				<tr>
					<th width="15%" >
						<?php echo JHTML::_('grid.sort',  'fecha', 'Fecha', @$lists['order_Dir'], @$lists['order'] ); ?>
					</th>
					<th width="50" scope="col" >
					   <?php echo JText::_( 'Atrasos/Inasistencias' ); ?>
					</th>	
				</tr>
			</thead>
			
			<?php
			$k = 0;
			for ($i=0, $n=count( $this->inasistencias ); $i < $n; $i++)
		    {
			$row = &$this->inasistencias[$i];
			?>
				<tr class="<?php echo "row$k"; ?>">
					<td align="left">
						<?php echo $row->fecha; ?>
					</td>
					<td align="left">
					<?php	if ($row->tipo=='Inasistencia'){
						?>
						<img src="<?php echo $imgX; ?>" border="0" alt="">
					<?php }else {?>
					<img src="<?php echo $imgY; ?>" border="0" alt="">
		    		<?php }
		    		?>
					</td>
					<td align="center">
						<?php echo $row->periodo;?>
					</td>
				</tr>
				<?php
				$k = 1 - $k;
			}
			?>
		</table>	
	<table class="adminlist">
		<tbody>
		<tr>

			<?php	/*<td width="80%">
					<?php echo $this->Example;?>
				</td> 
				*/?>
				<td width="80%">
					<?php //echo $this->CalendarioInasistencias;?>
				</td>
				<td>
					<tr>
						<table class="adminlist" border ="0">
							<thead>
								<tr>
									<th width="33%" align="left">
										<?php echo JText::_( 'Total de inasistencias:' ); ?><img src="<?php echo $imgX; ?>" border="0" alt="">
									 </th>
									<th width="33%" align="left"><?php echo JText::_( 'Total de atrasos:' ); ?><img src="<?php echo $imgY; ?>" border="0" alt=""></th>	
									<th width="33%" align="left"><?php echo JText::_( 'Porcentaje Asistencia:' ); ?></th>	 
								</tr>	
							</thead>
						</table>
					</tr>
				</td>
		</tr>
		</tbody>	
		</table>
		<?php
		echo '</div>';
		
		echo $pane1->endPanel();
			echo $pane1->startPanel( JTEXT::_('Cuotas'), 'nom_cp_cuotas' );
		echo '<div id="cpanel">';
		//echo SophiaHelperToolbar::IconButtonPdf( 'pdf', 'icons/pdf_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		//echo SophiaHelperToolbar::IconButtonPdf( 'print', 'icons/printer_32x32.png', JText::_( 'Pdf' ),JText::_( 'Pdf' ));
		
	?>
			<table class="adminlist" border ="0">
			<thead>
				<tr>
					<th width="15%" >
						<?php echo JHTML::_('grid.sort',  'id', 'id', @$lists['order_Dir'], @$lists['order'] ); ?>
					</th>
					<th width="50" scope="col" >
					   <?php echo JText::_( ' C U O T A' ); ?>
					</th>	
					<th width="30%" >
							<?php echo JText::_( 'Anno' ); ?>
					</th>	
					<th width="30%" >
							<?php echo JText::_( 'Pendiente/Pagada' ); ?>
					</th>	
				</tr>
			</thead>
			
			<?php
			$k = 0;
			for ($i=0, $n=count( $this->aranceles ); $i < $n; $i++)
		    {
			$row = &$this->aranceles[$i];
			?>
				<tr class="<?php echo "row$k"; ?>">
					<td align="left">
						<?php echo $row->id; ?>
					</td>
					<td align="left">
						<?php echo $row->cuota?>
					</td>
					<td align="center">
						<?php echo $row->anno;?>
					</td>
					<td align="center">
						<?php echo $row->estado;?>
					</td>
				</tr>
				<?php
				$k = 1 - $k;
			}
			?>
		</table>

	<?php
	echo '</div>';
	// nuevo panel 
		echo $pane1->endPanel();
		echo $pane1->endPane();
		?>	
<div class="clr"></div>
<p><?php echo JHTML::_('credit.credit');?></p>
